home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / program / swmp141.zip / PAS.DOC < prev    next >
Text File  |  1995-12-12  |  7KB  |  151 lines

  1.  
  2.  ┌────────────────────────────────────────────────────────────────────────────┐
  3.  │ Module Player V1.41     (c) 1994,1995 by Lord Excess of Sound Wizards Int. │
  4.  └────────────────────────────────────────────────────────────────────────────┘
  5.  
  6.  
  7.  
  8.         USING THE SWMP DRIVERS WITH 'TURBO PASCAL 7.0' (and below)
  9.         ──────────────────────────────────────────────────────────
  10.  
  11.          First of all you have to unzip the files of the included
  12.         archive PAS_SDK.ZIP to a location where the pascal compiler can
  13.         find them. This is either the directory where you keep your
  14.         source code or even better the Turbo Pascal directory itself.
  15.         The files you need in any case are:
  16.  
  17.               MODPLAY.PAS           : main unit
  18.               DETECT.PAS            : hardware detection unit
  19.               SB_DRV.PAS            : SoundBlaster unit
  20.               SBP_DRV.PAS           : SoundBlaster Pro unit
  21.               GUS_DRV.PAS           : Gravis UltraSound unit
  22.               DET_OBJ.OBJ           : detection code
  23.               SB_DRV.OBJ            : SB driver
  24.               SBP_DRV.OBJ           : SB Pro driver
  25.               GUS_DRV.OBJ           : GUS driver
  26.  
  27.          The rest are example files, which can be important to
  28.         understand things better. Now the only step to link all
  29.         mod-procedures and functions is to add the following statements
  30.         after your program heading:
  31.  
  32.               PROGRAM xxxxx;
  33.               {$M $4000,0,0}        : This sets the heap size to zero
  34.                                     : else the drivers cannot alloc memory
  35.               USES ModPlay;         : include unit ModPlay
  36.               ...
  37.               ..
  38.  
  39.          At program start you have to initialize this unit using the
  40.         following procedure:
  41.  
  42. ┌──INIT DRIVER─────────────────────────────────────────────────────────────────
  43. │       PROCEDURE Mod_Init(Driver,Port: WORD; IRQ,DMA: BYTE);
  44. │         -> Select and initialize driver for sound output
  45. │            Driver = Detection         (0) :  Port = 0
  46. │                                              IRQ  = 0
  47. │                                              DMA  = 0
  48. │                   = SoundBlaster      (1) :  Port = SB base address ($220..)
  49. │                                              IRQ  = SB IRQ#
  50. │                                              DMA  = 1 (always)
  51. │                   = SoundBlaster_Pro  (2) :  Port = SBP base address
  52. │                                              IRQ  = SBP IRQ#
  53. │                                              DMA  = SBP DMA channel
  54. │                   = Gravis_UltraSound (3) :  Port = GUS base address
  55. │                                              IRQ  = GF1 IRQ#
  56. │                                              DMA  = MIDI IRQ# !!
  57.  
  58.  
  59.          A very powerful hardware detection is able to detect any
  60.         supported soundcard with all required settings. So in general
  61.         the easiest way to init the drivers is:
  62.  
  63.                 MOD_Init(Detection,0,0,0);
  64.  
  65.          If all fails you can override detection and select one of the
  66.         drivers by yourself, but in this case you have to know (or ask
  67.         for) the settings of an installed soundcard.
  68.  
  69.          If you want to know if initialisation was successfull, have a
  70.         look at the variable Soundcard (WORD), which will contain the
  71.         output device:
  72.  
  73.               0:        no sound available
  74.               1:        SoundBlaster            [ 22.2 kHz mono     ]
  75.               2:        SoundBlaster Pro        [ 21.7 kHz stereo   ]
  76.               3:        Gravis UltraSound       [ 44.1 kHz +stereo+ ]
  77.  
  78.          You do not have to handle this variable. You can also call the
  79.         driver's subfunctions even if no soundcard was detected,
  80.         nothing will happen in this case.
  81.  
  82.          At program end the unit selfrestores any altered interrupt
  83.         vectors etc.
  84.  
  85.          The following functions & procedures are available:
  86.         (Note: The first two procedures are enough to playback a mod !!!)
  87.  
  88. ┌──LOAD MODULE─────────────────────────────────────────────────────────────────
  89. │       PROCEDURE Mod_Load(FileName: STRING);
  90. │         -> Stops possible sound output, loads module file into memory,
  91. │            but does no start playing. If successful the variable
  92. │            Channels (WORD) will contain the number of channels, else zero.
  93. ┌──PLAY MODULE─────────────────────────────────────────────────────────────────
  94. │       PROCEDURE Mod_Play(Looping: WORD);
  95. │         -> Starts playing previously loaded song. If looping is zero,
  96. │            song is played only once, else continuously.
  97. ┌──STOP MODULE─────────────────────────────────────────────────────────────────
  98. │       PROCEDURE Mod_Stop;
  99. │         -> Stops sound output at once.
  100. ┌──MAIN VOLUME─────────────────────────────────────────────────────────────────
  101. │       PROCEDURE Mod_Volume(Volume: BYTE);
  102. │         -> Changes the driver's main volume setting. Valid values are
  103. │            between 0 (lowest) and 64 (loudest).
  104. ┌──STATUS──────────────────────────────────────────────────────────────────────
  105. │       FUNCTION Mod_Status: WORD;
  106. │         -> Returns 1 if sound is being played, else 0.
  107. ┌──GET POSITION────────────────────────────────────────────────────────────────
  108. │       FUNCTION Mod_Position: WORD;
  109. │         -> Returns 256*PatternNumber+LineNumber. Can be useful to
  110. │            syncronize a special graphic effect to the sound.
  111. ┌──JUMP BACK───────────────────────────────────────────────────────────────────
  112. │       PROCEDURE Mod_Rewind;
  113. │         -> Decreases current songposition. No effect in first pattern.
  114.  
  115. ┌──JUMP FORWARD────────────────────────────────────────────────────────────────
  116. │       PROCEDURE Mod_Forward;
  117. │         -> Increases current songposition. No effect in last pattern.
  118. ┌──PEAKS───────────────────────────────────────────────────────────────────────
  119. │       PROCEDURE Mod_Peak(VAR Peaks);
  120. │         -> Updates the array Peaks by copying the driver's volume
  121. │            setting (0..64) of each channel. The number of channels
  122. │            can be found in the variable Channels (WORD) and is either
  123. │            four, six or eight.
  124.  
  125.  
  126.          In general it remains to be said that you can do as much error
  127.         checking as you like, but it is not necessary. In a demo or
  128.         intro for example you do not care if there is sound available
  129.         to the grafix you produce on the screen (in most cases). But in
  130.         a player it is evident that you need to have any sounddevice at
  131.         all to output the sound! The best way is to take a look at the
  132.         example programs. Have a lot of fun!
  133.  
  134.  
  135.                                                Lord Excess in Dezember '95
  136. 
  137.